package com.laicunba.test.service;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

import org.apache.commons.io.IOUtils;

public class PidQuery {

	public static void main(String[] args) throws IOException {
		HttpURLConnection conn = null;
		try {
			URL url = new URL("http://apis.baidu.com/apistore/idservice/id?id=362523198608242019");
			conn = (HttpURLConnection) url.openConnection();
			conn.addRequestProperty("apikey", "ad7e49ee7040889350776cf46e1fd704");
			String content = IOUtils.toString(conn.getInputStream());
			System.out.println(new String(content.getBytes("iso-8859-1"), "utf-8"));
		} finally {
			conn.disconnect();
		}
	}

}
